<?php
require('phpQuery/phpQuery/phpQuery.php');
$masterContent = file_get_contents('html.txt');
$doc = phpQuery::newDocumentHTML($masterContent);
preg_match('#<title.*?>(.*?)</title>#is', $masterContent, $match);
echo $match[1];
die;
echo $title = pq('title', $doc)->text();